package cn.gson.crm.model.pojos;

import javax.persistence.*;
import java.util.Date;
import java.util.List;
import java.util.Objects;

@Entity
public class Linkman {
    private long linkId;
    private String linkName;
    private String linkPhone;
    private String linkRole;
    private String linkAddress;
    private String linkLeader;
    private Date linkDate;
    private String linkRemark;
    private String linkProvince;
    private String linkCity;
    private String linkArea;
    private Customer customerByCustomerId;
    private List<Contract> contract;

    @OneToMany(mappedBy = "linkId")
    public List<Contract> getContract() {
        return contract;
    }

    public void setContract(List<Contract> contract) {
        this.contract = contract;
    }

    @Id
    @Column(name = "link_id")
    @GeneratedValue(generator  =  "seq",strategy  =  GenerationType.SEQUENCE)
    //定义一个序列生成器
    @SequenceGenerator(name  =  "seq",sequenceName  =  "crm",
            initialValue  =  1,allocationSize  =  1)
    public long getLinkId() {
        return linkId;
    }

    public void setLinkId(long linkId) {
        this.linkId = linkId;
    }

    @Basic
    @Column(name = "link_name")
    public String getLinkName() {
        return linkName;
    }

    public void setLinkName(String linkName) {
        this.linkName = linkName;
    }

    @Basic
    @Column(name = "link_phone")
    public String getLinkPhone() {
        return linkPhone;
    }

    public void setLinkPhone(String linkPhone) {
        this.linkPhone = linkPhone;
    }

    @Basic
    @Column(name = "link_role")
    public String getLinkRole() {
        return linkRole;
    }

    public void setLinkRole(String linkRole) {
        this.linkRole = linkRole;
    }

    @Basic
    @Column(name = "link_address")
    public String getLinkAddress() {
        return linkAddress;
    }

    public void setLinkAddress(String linkAddress) {
        this.linkAddress = linkAddress;
    }

    @Basic
    @Column(name = "link_leader")
    public String getLinkLeader() {
        return linkLeader;
    }

    public void setLinkLeader(String linkLeader) {
        this.linkLeader = linkLeader;
    }

    @Basic
    @Column(name = "link_date")
    public Date getLinkDate() {
        return linkDate;
    }

    public void setLinkDate(Date linkDate) {
        this.linkDate = linkDate;
    }

    @Basic
    @Column(name = "link_remark")
    public String getLinkRemark() {
        return linkRemark;
    }

    public void setLinkRemark(String linkRemark) {
        this.linkRemark = linkRemark;
    }

    @Basic
    @Column(name = "link_province")
    public String getLinkProvince() {
        return linkProvince;
    }

    public void setLinkProvince(String linkProvince) {
        this.linkProvince = linkProvince;
    }

    @Basic
    @Column(name = "link_city")
    public String getLinkCity() {
        return linkCity;
    }

    public void setLinkCity(String linkCity) {
        this.linkCity = linkCity;
    }

    @Basic
    @Column(name = "link_area")
    public String getLinkArea() {
        return linkArea;
    }

    public void setLinkArea(String linkArea) {
        this.linkArea = linkArea;
    }

    @ManyToOne
    @JoinColumn(name = "customer_id", referencedColumnName = "customer_id")
    public Customer getCustomerByCustomerId() {
        return customerByCustomerId;
    }

    public void setCustomerByCustomerId(Customer customerByCustomerId) {
        this.customerByCustomerId = customerByCustomerId;
    }
}
